package com.esri.core.geodatabase;

import com.esri.core.map.FeatureEditError;
import java.io.Serializable;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class GeodatabaseEditError implements Serializable {
    private static final long serialVersionUID = 1;
    private long a;
    private String b;
    private long c;
    private String d;
    private FeatureEditError e;
    private String f;
    private int g;
    private EditOperation h;
    private String i;

    /* loaded from: classes.dex */
    public enum EditOperation {
        ADD(1),
        UPDATE(2),
        DELETE(3);
        
        private int a;

        EditOperation(int i) {
            this.a = i;
        }

        static EditOperation a(int i) {
            if (i == 1) {
                return ADD;
            }
            if (i == 2) {
                return UPDATE;
            }
            if (i == 3) {
                return DELETE;
            }
            return null;
        }

        int a() {
            return this.a;
        }
    }

    GeodatabaseEditError() {
        this.a = -1L;
        this.c = -1L;
        this.g = -1;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeodatabaseEditError(long j, String str, EditOperation editOperation, FeatureEditError featureEditError, int i, String str2) {
        this.a = -1L;
        this.c = -1L;
        this.g = -1;
        this.c = j;
        this.d = str;
        this.h = editOperation;
        this.e = featureEditError;
        this.g = i;
        this.f = str2;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeodatabaseEditError(long j, String str, long j2, String str2, EditOperation editOperation, FeatureEditError featureEditError, int i, String str3) {
        this(j, str, editOperation, featureEditError, i, str3);
        this.a = j2;
        this.b = str2;
    }

    public long getAttachmentObjectId() {
        return this.a;
    }

    public String getAttachmentGlobalId() {
        return this.b;
    }

    public long getObjectId() {
        return this.c;
    }

    public String getGlobalId() {
        return this.d;
    }

    public FeatureEditError getError() {
        return this.e;
    }

    public int getLayerId() {
        return this.g;
    }

    public String getTableName() {
        return this.f;
    }

    public String getParentTableName() {
        return this.i;
    }

    public EditOperation getEditOperation() {
        return this.h;
    }

    public boolean isAttachment() {
        return this.b != null;
    }

    public static GeodatabaseEditError fromJson(JsonParser jsonParser) throws Exception {
        if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        GeodatabaseEditError geodatabaseEditError = new GeodatabaseEditError();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("objectId".equals(currentName)) {
                geodatabaseEditError.c = jsonParser.getLongValue();
            } else if ("globalId".equals(currentName)) {
                geodatabaseEditError.d = jsonParser.getText();
            } else if ("attachmentObjectId".equals(currentName)) {
                geodatabaseEditError.a = jsonParser.getLongValue();
            } else if ("attachmentGlobalId".equals(currentName)) {
                geodatabaseEditError.b = jsonParser.getText();
            } else if ("parentObjectId".equals(currentName)) {
                geodatabaseEditError.c = jsonParser.getLongValue();
            } else if ("parentGlobalId".equals(currentName)) {
                geodatabaseEditError.d = jsonParser.getText();
            } else if ("error".equals(currentName)) {
                geodatabaseEditError.e = FeatureEditError.fromJson(jsonParser);
            } else if ("layerId".equals(currentName)) {
                geodatabaseEditError.g = jsonParser.getIntValue();
            } else if ("tableName".equals(currentName)) {
                geodatabaseEditError.f = jsonParser.getText();
            } else if ("parentTableName".equals(currentName)) {
                geodatabaseEditError.i = jsonParser.getText();
            } else if ("changeType".equals(currentName)) {
                geodatabaseEditError.h = EditOperation.a(jsonParser.getIntValue());
            } else {
                jsonParser.skipChildren();
            }
        }
        return geodatabaseEditError;
    }

    public String toString() {
        return "FeatureEditResult [objectId=" + this.c + ", globalId=" + this.d + ", error=" + this.e + "]";
    }
}
